package practice02;

import java.util.Objects;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice02
 * @ClassName: Employee
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/16 19:30
 * @Copyright 大牛版板所有
 */
public class Employee {
    private String name;
    private int workId;
    private int age;
    private double wages;

    public Employee() {
    }

    public Employee(String name, int workId, int age, double wages) {
        this.name = name;
        this.workId = workId;
        this.age = age;
        this.wages = wages;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWorkId() {
        return workId;
    }

    public void setWorkId(int workId) {
        this.workId = workId;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getWages() {
        return wages;
    }

    public void setWages(double wages) {
        this.wages = wages;
    }

    public void work(){
        System.out.println("java公司上班");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Employee)) return false;
        Employee employee = (Employee) o;
        return getWorkId() == employee.getWorkId() &&
                Objects.equals(getName(), employee.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName(), getWorkId());
    }
}
